package labilabyrinth.activity;

import labilabyrinth.game.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;

public class LevelNameActivity extends Activity{
   
	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        this.setTitle("Please enter level name");
        setContentView(R.layout.lvl_save_dialog);
    }
    
    public void startLevelEditing(View v){
		 Intent intent = new Intent(this, LevelEditorActivity.class);
		 String name = "default";
		 int index = 0;
		 EditText t1 = (EditText) findViewById(R.id.editText_order);
		 EditText t2 = (EditText) findViewById(R.id.editText_name);
		 if(t1.getText().length() > 0)
			 index = Integer.parseInt(t1.getText().toString());
		 if(t2.getText().length() > 0)
			 name = t2.getText().toString();
		 
		 intent.putExtra("level_index", index);
		 intent.putExtra("level_name", name);
		 startActivity(intent);
    }

}
